package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 产品入库录表
 * @TableName wm_product_recpt
 */
@TableName(value ="wm_product_recpt")
@Data
public class WmProductRecpt implements Serializable {
    /**
     * 入库单ID
     */
    @TableId(type = IdType.AUTO)
    private Long recptId;

    /**
     * 入库单编号
     */
    private String recptCode;

    /**
     * 入库单名称
     */
    private String recptName;

    /**
     * 生产工单ID
     */
    private Integer workorderId;

    /**
     * 生产工单编码
     */
    private String workorderCode;

    /**
     * 生产工单名称
     */
    private String workorderName;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 入库日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date recptDate;

    /**
     * 单据状态
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 产品编码
     */
    private String productCode;


    /**
     * 产品名称
     */
    private String productName;


    /**
     * 子表集合
     */
    @TableField(exist = false)
    private List<WmProductRecptLine> line;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WmProductRecpt other = (WmProductRecpt) that;
        return (this.getRecptId() == null ? other.getRecptId() == null : this.getRecptId().equals(other.getRecptId()))
            && (this.getRecptCode() == null ? other.getRecptCode() == null : this.getRecptCode().equals(other.getRecptCode()))
            && (this.getRecptName() == null ? other.getRecptName() == null : this.getRecptName().equals(other.getRecptName()))
            && (this.getWorkorderId() == null ? other.getWorkorderId() == null : this.getWorkorderId().equals(other.getWorkorderId()))
            && (this.getWorkorderCode() == null ? other.getWorkorderCode() == null : this.getWorkorderCode().equals(other.getWorkorderCode()))
            && (this.getWorkorderName() == null ? other.getWorkorderName() == null : this.getWorkorderName().equals(other.getWorkorderName()))
            && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
            && (this.getRecptDate() == null ? other.getRecptDate() == null : this.getRecptDate().equals(other.getRecptDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
             && (this.getProductCode() == null ? other.getProductCode() == null : this.getProductCode().equals(other.getProductCode()))
                && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecptId() == null) ? 0 : getRecptId().hashCode());
        result = prime * result + ((getRecptCode() == null) ? 0 : getRecptCode().hashCode());
        result = prime * result + ((getRecptName() == null) ? 0 : getRecptName().hashCode());
        result = prime * result + ((getWorkorderId() == null) ? 0 : getWorkorderId().hashCode());
        result = prime * result + ((getWorkorderCode() == null) ? 0 : getWorkorderCode().hashCode());
        result = prime * result + ((getWorkorderName() == null) ? 0 : getWorkorderName().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getRecptDate() == null) ? 0 : getRecptDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getProductCode() == null) ? 0 : getProductCode().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recptId=").append(recptId);
        sb.append(", recptCode=").append(recptCode);
        sb.append(", recptName=").append(recptName);
        sb.append(", workorderId=").append(workorderId);
        sb.append(", workorderCode=").append(workorderCode);
        sb.append(", workorderName=").append(workorderName);
        sb.append(", specification=").append(specification);
        sb.append(", recptDate=").append(recptDate);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", productCode=").append(productCode);
        sb.append(", productName=").append(productName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}